package com.demo.Rabbit;

import com.demo.entity.BookOrder;
import com.demo.service.IBookOrderService;
import com.demo.service.IBookService;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "s59")
public class BookOrderMQ {
    @Autowired
    private IBookOrderService iBookOrderService;
    @RabbitHandler
    public void BookOrder(BookOrder order){
        System.out.println("123123123123");
        iBookOrderService.save(order);
    }
}